package com.guaoran.micro.services.spring.cloud.eureka.client.user.service.provider.service;

import com.guaoran.micro.services.spring.cloud.eureka.client.user.api.domain.User;
import com.guaoran.micro.services.spring.cloud.eureka.client.user.api.service.UserService;
import com.guaoran.micro.services.spring.cloud.eureka.client.user.service.provider.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;

/**
 * {@link UserService 用户服务} 提供者实现
 *
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserRepository userRepository;

    @Override
    public boolean save(User user) {
        return userRepository.save(user);
    }

    @Override
    public Collection<User> findAll() {
        return userRepository.findAll();
    }

    @Override
    public String hystrix() {
        return null;
    }
}
